package cn.openea.perpartner.link.web.entity.base;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.util.List;

/**
 * @author ysk
 * @version 1.0.1
 * @Description 批量操作父Vo
 * @createTime 2023年04月19日 13:42:00
 */
public class BatchQuery<ID, VO> {

    /**
     * 批量操作的主键
     */
    private List<ID> batchIds;

    /**
     * 查询的VO 查询条件
     */
    private VO queryVO;

    /**
     * 查询类型 1 根据vo 0 根据id
     */
    @Max(1)
    @Min(0)
    private Short batchType = 0;

    /**
     *
     */
    public boolean byVO() {
        return this.batchType == 1;
    }

    /**
     * 是否根据 批量操作
     */
    public boolean byIds() {
        return this.batchType == 0;
    }

    public List<ID> getBatchIds() {
        return batchIds;
    }

    public void setBatchIds(List<ID> batchIds) {
        this.batchIds = batchIds;
    }

    public VO getQueryVO() {
        return queryVO;
    }

    public void setQueryVO(VO queryVO) {
        this.queryVO = queryVO;
    }

    public Short getBatchType() {
        return batchType;
    }

    public void setBatchType(Short batchType) {
        this.batchType = batchType;
    }

}
